package com.syni.mdd.yhd.common.all.controller.protect;

import com.syni.mdd.sjb.common.component.utils.common.annotations.CheckParams;
import com.syni.mdd.yhd.common.all.service.BmsFullCouponService;
import com.syni.mdd.sjb.common.component.utils.common.utils.ParamsMap;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;

/**
 * @className BmsFullCouponController
 * @description TOO
 * @Author cfx
 * @DATE 2019/9/15 22:05
 * @VERSION 1.0
 **/
@RestController
@RequestMapping("/fullCoupon")
public class BmsFullCouponController {
    @Autowired
    BmsFullCouponService bmsFullCouponService;

    /**
     * @Description 开启活动
     * @Author: cfx
     * @Date: 2019/8/2
     */
    @PostMapping("openFullCopuon")
    @CheckParams
    public Map<String,Object> openFullCopuon(@RequestBody ParamsMap paramsMap){
        return bmsFullCouponService.openFullCopuon(paramsMap);
    }

    /**
     * @Description 用户端获取商家满减券
     * @Author: cfx
     * @Date: 2019/8/2
     */
    @PostMapping("getBusinessFullCoupon")
    @CheckParams
    public Map<String,Object> getBusinessFullCoupon(@RequestBody ParamsMap paramsMap){
        return bmsFullCouponService.getBusinessFullCoupon(paramsMap);
    }

    /**
     * @Description 判断用户是否领取5张满减券
     * @Author: cfx
     * @Date: 2019/8/2
     */
    @PostMapping("checkUserIsReceive")
    @CheckParams(checkAuth = true)
    public Map<String,Object> checkUserIsReceive(@RequestBody ParamsMap paramsMap){
        return bmsFullCouponService.checkUserIsReceive(paramsMap);
    }

    /**
     * @Description 领取商家满减券
     * @Author: cfx
     * @Date: 2019/8/2
     */
    @PostMapping("userReceiveFullCoupon")
    @CheckParams(checkAuth = true,params = {"businessId"})
    public Map<String,Object> userReceiveFullCoupon(@RequestBody ParamsMap paramsMap){
        return bmsFullCouponService.userReceiveFullCoupon(paramsMap);
    }
}
